<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/include/include.jsp"%>

<div class="pageContent">
	<form action="<c:if test="${not empty user}"><c:url value="/user/edit"/></c:if><c:if test="${empty user}"><c:url value="/user/add"/></c:if>" 
		method="post" onsubmit="return validateCallback(this, navTabAjaxDone)">
	<div class="pageFormContent" layoutH="56">
		<p>
			<label><fmt:message key="page.user.usercode"/>：</label>
			<input name="code" type="text" size="30" value="${user.code}"
			 	<c:if test="${not empty user}"> readonly="readonly"</c:if>
			 	<c:if test="${empty user}"> onblur="ajaxValidator(this,'<c:url value="/user/validateCode"/>')" </c:if> 
			 	class="required {rangelength:[2,32]}"/>
		</p>
		<p>
			<label><fmt:message key="page.user.username"/>：</label>
			<input name="name" type="text" size="30" value="${user.name}" class="required"/>
		</p>
		<p>
			<label><fmt:message key="page.user.realname"/>：</label>
			<input name="realName" type="text" size="30" value="${user.realName}" class="required"/>
		</p>
		<p>
			<label><fmt:message key="page.user.birthday"/>：</label>
			<input name="birthday" type="text" size="30" class="date required" value="${user.birthday}"/><a class="inputDateButton" href="javascript:;">选择</a>
		</p>
		<p>
			<label><fmt:message key="page.user.sex"/>：</label>
			<select name="sex" class="combox" class="required">
				<youthburin:dict model="rmp" type="sex">
					<c:forEach items="${RMP_PAGE_DICT_SEX}" var="sex">
						<option value="${sex.code}" <c:if test="${sex.code eq user.sex}">selected</c:if>>${sex.name}</option>
					</c:forEach>
				</youthburin:dict>
			</select>
		</p>
		<p>
			<label><fmt:message key="page.user.dept"/>：</label>
			<input name="dept.code" type="hidden" value="${deptCode }">
			<input name="dept.name" type="text" size="30" value="${deptName}" readonly="readonly" class="required"/>
			<a class="btnLook" href="<c:url value="/dept/tree/"/>" lookupGroup="dept"><fmt:message key="page.user.chooseparentdept"/></a>	
		</p>
		<p>
			<label><fmt:message key="page.user.telephone"/>：</label>
			<input name="telephone" type="text" size="30" value="${user.telephone}" class="phone"/>
		</p>
		<p>
			<label><fmt:message key="page.user.mobile"/>：</label>
			<input name="mobile" type="text" size="30" value="${user.mobile}" class="phone"/>
		</p>
		<p>
			<label><fmt:message key="page.user.fax"/>：</label>
			<input name="fax" type="text" size="30" value="${user.fax}" class="phone"/>
		</p>
		<p>
			<label><fmt:message key="page.user.email"/>：</label>
			<input name="email" type="text" size="30" value="${user.email}" class="email"/>
		</p>
	</div>
	
	<div class="formBar">
		<ul>
			<c:if test="${readOnly ne '1'}">
				<youthburin:hasAnyPermissions name="user:add,user:edit">
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit"><fmt:message key="page.button.save"/></button>
							</div>
						</div>
					</li>
				</youthburin:hasAnyPermissions>
			</c:if>
			<li>
				<div class="button">
					<div class="buttonContent">
						<button type="button" class="close"><fmt:message key="page.button.cancel"/></button>
					</div>
				</div>
			</li>
		</ul>
	</div>
	</form>
</div>